package com.leyou.item.mapper;

import com.leyou.item.entitiy.TbBrand;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 品牌表，一个品牌下有多个商品（spu），一对多关系 Mapper 接口
 * </p>
 *
 * @author HM
 * @since 2021-06-16
 */
public interface TbBrandMapper extends BaseMapper<TbBrand> {
    @Select("SELECT b.* FROM tb_category_brand a ,tb_brand b " +
            "WHERE a.`brand_id` = b.`id` AND a.`category_id`=#{categoryId}")
    List<TbBrand> selectBrandJoinCategory(Long categoryId);
}
